-
-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DashboardLayout component to @toolpad/core #3554
Add DashboardLayout component to @toolpad/core #3554
Conversation
@@ -0,0 +1,69 @@ | |||
import * as React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this hand-written? I think we should port the docs:typescript:formatted
script from core
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hadn't noticed that, I guess I can include it in this PR if it's simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added it here, seems to work fine 9465e74
@@ -0,0 +1,3 @@ | |||
# Dashboard Layout API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the API, let's port the docs generator from X?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do that in this separate PR, right? #3536
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, the X one, I was checking the Base one, will take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes, base may be better
This should be ready as a first version of the |
docs/data/toolpad/studio/pages.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe this file is expected to be here. I think it was generated by the demo formatter script. I added a rule in the ignore list as I saw this happening when porting the script from X repo
docs/data/toolpad/core/pages.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe this file is expected here, see my other comment below
export interface NavigationPageItem { | ||
kind?: 'page'; | ||
title: string; | ||
path?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the nomenclature path
I'd expect it to be the full path. Maybe we need to come up with another name e.g. like "slug"? That way we can later still add path
if we want to add an override in the future.
path?: string; | |
slug: string; |
scripts/coreTypeScriptProjects.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 The file is already in the project, with different casing
Isolated DashboardLayout component and its docs from #3343 and implemented review feedback.
Docs/demo: https://deploy-preview-3554--mui-toolpad-docs.netlify.app/toolpad/core/components/dashboard-layout/
(once we have a navigation adapter we can make the demo sidebar links work with local state to provide better examples)
(API docs generation to be added next in separate PR)
Summary
Please check the types in packages/toolpad-core/src/AppProvider/AppProvider.tsx for the chosen API.
Possible to import types such as
Branding
andNavigation
from@toolpad/core
.Also added
@toolpad/core/themes
where thebaseTheme
we use can be imported from, and that we use as a default theme. Eventually we can provide more themes?Addressed PR comments